<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .father{
            width: 500px;
            height: 300px;
            background-color: pink;
            border: 10px solid red;
            /* 子盒子浮动不会压住父亲的padding 和border */
            padding: 20px; 
        }
        /* 浮动不会超过内边距的 */
        .son{
            width: 200px;
            height: 200px;
            background-color: purple;
            float: right;
        }

    </style>
</head>
<body>
    <div class="father">
        <div class="son"></div>
    </div>
    </body>
</html>